<?php
include 'config.php';
$result = mysql_query("SELECT * FROM `places` WHERE `id` = '".$_REQUEST['id']."'");
$getPlaces = mysql_fetch_assoc($result);

if(!isset($_REQUEST['year'])) $year = date('Y');
else $year = $_REQUEST['year'];

/* For Descriptions */
$tmp = mysql_query("SELECT * FROM `descriptions` WHERE `year` = '".$year."' AND `placeid` = ".$_REQUEST['id']);
$getDescription = mysql_fetch_assoc($tmp);

$getYearRes = mysql_query("SELECT `year` FROM `descriptions` WHERE `placeid` = ".$_REQUEST['id']);
?>

<style>
.places_name { border-radius: 3px; height:30px; line-height:30px; padding-left: 5px; background-color: #EEE; }
.places_desc { padding-left: 5px; margin-top: 10px; }
.places_longdesc { padding-left: 5px; margin-top: 20px; }
</style>
<form method="post" enctype="multipart/form-data">
<div style="text-align:justify;">
    <div class="places_name"><strong><?=$getPlaces['name']?> 
    
<select name="year" onchange="submit()">
    <?php
	while($getYear = mysql_fetch_assoc($getYearRes)){
		echo '<option value="'.$getYear['year'].'" '.($getYear['year']==$year?'selected="selected"':'').'>'.$getYear['year'].'</option>';
	}
	?>
    </select>
</strong></div>
    <div class="places_desc"><?=$getDescription['description']?></div>
    <div class="places_longdesc"><?=$getDescription['long_description']?></div>
</div>
</form>